<!-- "Video For Everybody" v0.4.2 by Kroc Camen of Camen Design -->
<video class="video"
       id="video-<?php echo $id ?>"
       title="<?php echo $title ?>"
       poster="<?php echo $poster ?>"
       width="<?php echo $width ?>"
       height="<?php echo $height ?>"
       controls>
           <?php foreach ($sources as $source) : ?>
        <source src="<?php echo $source['src'] ?>"
                type='<?php echo $source['type'] ?>' />
            <?php endforeach; ?>
            <?php foreach ($tracks as $track) : ?>
        <track src="<?php echo $track['src'] ?>"
               kind="<?php echo $track['kind'] ?>"
               srclang="<?php echo $track['srclang'] ?>"
               label="<?php echo $track['label'] ?>" />
           <?php endforeach; ?>
           <?php if ($flashVideo) : ?>
        <object width="<?php echo $width ?>" height="<?php echo $height ?>"
                type="application/x-shockwave-flash"
                data="<?php echo html5av_manager::getUrl(); ?>/lib/mediaelement/flashmediaelement.swf">
            <param name="movie"
                   value="<?php echo html5av_manager::getUrl(); ?>/lib/mediaelement/flashmediaelement.swf" />
            <param name="flashvars" value="controls=true&amp;poster=<?php echo $poster ?>&amp;file=<?php echo $flashVideo ?>" />
            <!-- Image as a last resort -->
            <img src="<?php echo $poster ?>"
                 width="<?php echo $width ?>"
                 height="<?php echo $height ?>"
                 title="No video playback capabilities, please download the video below"
                 alt="<?php echo $alt ?>"/>
        </object>
    <?php endif; ?>
</video>

<?php if (count($closedLinks) || count($openLinks)) : ?>
    <p>
        <strong>Download Video:</strong>
        <?php if (count($closedLinks)) : ?>
            Closed Format:
            <?php foreach ($closedLinks as $link) : ?>
                <a href="<?php echo $link['href'] ?>"
                   ><?php echo $link['name'] ?></a> 
               <?php endforeach; ?>
           <?php endif; ?>

        <?php if (count($openLinks)) : ?>
            Open Format:
            <?php foreach ($openLinks as $link) : ?>
                <a href="<?php echo $link['href'] ?>"
                   ><?php echo $link['name'] ?></a> 
               <?php endforeach; ?>
           <?php endif; ?>
    </p>
<?php endif; ?>

<script type="text/javascript">
    jQuery('#video-<?php echo $id ?>').mediaelementplayer();
</script>